diff options
Diffstat (limited to 'app/[lng]/procurement/(procurement)/report/page.tsx')
| -rw-r--r-- | app/[lng]/procurement/(procurement)/report/page.tsx | 105 |
1 files changed, 0 insertions, 105 deletions
diff --git a/app/[lng]/procurement/(procurement)/report/page.tsx b/app/[lng]/procurement/(procurement)/report/page.tsx deleted file mode 100644 index 2782c3ac..00000000 --- a/app/[lng]/procurement/(procurement)/report/page.tsx +++ /dev/null @@ -1,105 +0,0 @@ -import * as React from "react"; -import { Skeleton } from "@/components/ui/skeleton"; -import { Shell } from "@/components/shell"; -import { ErrorBoundary } from "@/components/error-boundary"; -import { getDashboardData } from "@/lib/dashboard/service"; -import { DashboardClient } from "@/lib/dashboard/dashboard-client"; - -// 데이터 fetch 시 비동기 함수 호출 후 await 하므로 static-pre-render 과정에서 dynamic-server-error 발생. -// 따라서, dynamic 속성을 force-dynamic 으로 설정하여 동적 렌더링 처리 -// getDashboardData 함수에 대한 Promise를 넘기는 식으로 수정하게 되면 force-dynamic 선언을 제거해도 됨. -export const dynamic = 'force-dynamic' - -export default async function IndexPage() { - // domain을 명시적으로 전달 - const domain = "procurement"; - - try { - // 서버에서 직접 데이터 fetch - const dashboardData = await getDashboardData(domain); - - return ( - <Shell className="gap-2"> - <DashboardClient initialData={dashboardData} /> - </Shell> - ); - } catch (error) { - console.error("Dashboard data fetch error:", error); - return ( - <Shell className="gap-2"> - <div className="flex items-center justify-center py-12"> - <div className="text-center space-y-2"> - <p className="text-destructive">데이터를 불러오는데 실패했습니다.</p> - <p className="text-muted-foregroucdnd text-sm">{error instanceof Error ? error.message : "알 수 없는 오류가 발생했습니다."}</p> - </div> - </div> - </Shell> - ); - } -} - -function DashboardSkeleton() { - return ( - <div className="space-y-6"> - {/* 헤더 스켈레톤 */} - <div className="flex items-center justify-between"> - <div className="space-y-2"> - <Skeleton className="h-8 w-48" /> - <Skeleton className="h-4 w-72" /> - </div> - <Skeleton className="h-10 w-24" /> - </div> - - {/* 요약 카드 스켈레톤 */} - <div className="grid gap-4 md:grid-cols-2 lg:grid-cols-4"> - {[...Array(4)].map((_, i) => ( - <div key={i} className="space-y-3 p-6 border rounded-lg"> - <div className="flex items-center justify-between"> - <Skeleton className="h-4 w-16" /> - <Skeleton className="h-4 w-4" /> - </div> - <Skeleton className="h-8 w-12" /> - <Skeleton className="h-3 w-20" /> - </div> - ))} - </div> - - {/* 차트 스켈레톤 */} - <div className="grid grid-cols-1 lg:grid-cols-2 gap-6"> - {[...Array(2)].map((_, i) => ( - <div key={i} className="space-y-4 p-6 border rounded-lg"> - <div className="space-y-2"> - <Skeleton className="h-6 w-32" /> - <Skeleton className="h-4 w-48" /> - </div> - <Skeleton className="h-[300px] w-full" /> - </div> - ))} - </div> - - {/* 탭 스켈레톤 */} - <div className="space-y-4"> - <Skeleton className="h-10 w-64" /> - <div className="grid gap-4 md:grid-cols-2 lg:grid-cols-3"> - {[...Array(6)].map((_, i) => ( - <div key={i} className="space-y-4 p-6 border rounded-lg"> - <Skeleton className="h-6 w-32" /> - <div className="space-y-3"> - <div className="flex justify-between"> - <Skeleton className="h-4 w-16" /> - <Skeleton className="h-4 w-12" /> - </div> - <div className="flex gap-2"> - <Skeleton className="h-6 w-16" /> - <Skeleton className="h-6 w-16" /> - <Skeleton className="h-6 w-16" /> - </div> - <Skeleton className="h-2 w-full" /> - </div> - </div> - ))} - </div> - </div> - </div> - ); -} |
